<template>
{{#if page.psSysPFPlugin}}
    <{{pascalCase page.psSysPFPlugin.pluginCode}} />
{{else}}
    {{#if page.psViewLayoutPanel.useDefaultLayout}}
    <AppViewLayout :class="classNames">
        {{> @macro/view/view-toolbar.hbs page=page}}
        {{#page.ctrls}}
        {{#eq controlType 'PICKUPVIEWPANEL'}}
        <template #default>
        <div class="view-content__body__transfer">
            <div class="view-content__body__transfer__left">
                {{> @macro/widgets/pickup-view-panel/pickup-view-panel.hbs ctrl=ctrl props=":singleSelect='false'"}}
            </div>
        </div>
        </template>
        {{/eq}}
        {{/page.ctrls}}
        <template #viewFooter>
            <div class="view-footer__buttons footer__buttons">
                <AppButton type="primary" :disabled="store.selections.length === 0" @click="handlePickupViewButtonAction(controller, 'confirm')">\{{$t('app.common.confirm', '确认')}}</AppButton>
                <AppButton @click="handlePickupViewButtonAction(controller, 'cancel')">\{{$t('app.common.cancel', '取消')}}</AppButton>
            </div>
        </template>
        {{> @macro/view/view-msg.hbs}}  
    </AppViewLayout>
    {{else}}
    <div :class="classNames">
        {{#if page.psViewLayoutPanel.rootPSPanelItems}}
        {{#each page.psViewLayoutPanel.rootPSPanelItems as | panelItem |}}
        {{> @macro/widgets/panel-detail/include-panel.hbs type=panelItem.itemType item=panelItem isMultiData=false panel=page.psViewLayoutPanel page=page}}
        {{/each}}
        {{/if}}
    </div> 
    {{/if}}
{{/if}}
</template>

// 基于template/src/views/\{{appModules}}/\{{pages@DEMOBMPICKUPVIEW}}/\{{spinalCase page.codeName}}.vue.hbs生成
<script setup lang="ts">
{{#if page.psViewLayoutPanel.useDefaultLayout}}
import { AppViewLayout } from "@components/layout/view-layout";
{{> @macro/widgets/ctrl/import-ctrl.hbs ctrls=page.ctrls}}
{{else}}
import { AppCtrlPos, AppScrollContainer, AppSimpleFlexContainer, AppStandardContainer, AppTabPanel, AppTabPage } from '@components/layout-element/structure';
{{#if page.psViewLayoutPanel.viewProxyMode}}
{{> @macro/widgets/ctrl/import-ctrl.hbs ctrls=page.psViewLayoutPanel.psControls}}
{{else}}
{{> @macro/widgets/ctrl/import-ctrl.hbs ctrls=page.ctrls}}
{{/if}}
{{/if}}
import { model } from "./{{spinalCase page.codeName}}-model";
import { 
    useNavParamsBind, 
    useEventBind, 
    getViewClassNames, 
    handlePickupViewButtonAction, 
    handleCtrlAction, 
    handleCtrlInit, 
    handleCtrlDestroy, 
    getViewBackVisible,
{{#unless page.psViewLayoutPanel.useDefaultLayout}}
    handleComponentAction,
    {{#if page.psViewLayoutPanel.psControls}}
    {{#each page.psViewLayoutPanel.psControls as | ctrl |}}
    {{#eq ctrl.controlType 'TOOLBAR'}}
    handleToolbarItemClick,
    {{/eq}}
    {{/each}}
    {{/if}}
{{/unless}}
} from "@/hooks/use-view";
import { MPickupViewActionType, MPickupViewController, IMPickupViewAbility, IMPickupViewControllerParams, IMPickupViewStore, IMPickupViewController, IParam, IContext, ILoadingHelper } from "@/core";
{{> @macro/view/view-props.hbs}}

{{> @macro/common/emit.hbs name="view" actionType="MPickupViewActionType" ability="IMPickupViewAbility"}}

//  样式名称
const classNames = computed(() => {
    return getViewClassNames(model, props);
});

const params: IMPickupViewControllerParams<MPickupViewActionType, IMPickupViewAbility> = {
    name: props.name,
    model,
    evt,
    isLoadDefault: props.isLoadDefault,
    openType: props.openType,
    pLoadingHelper: props.pLoadingHelper,
    handler: (data: IMPickupViewStore) => { return reactive(data); }
}

{{> @macro/common/controller.hbs name="view" IController="IMPickupViewController" store="IMPickupViewStore" ability="IMPickupViewAbility" controller="MPickupViewController"}}
// 视图关闭方法
const handleViewClose=()=>{
    handlePickupViewButtonAction(controller, 'cancel')
}

// 返回按钮显示状态
const viewBackVisible = computed(() => {
    return getViewBackVisible(model, props);
});
</script>
